﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:vm="clr-namespace:Lithnet.Acma.Presentation"
                    xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase">

    <DataTemplate DataType="{x:Type vm:AttributeConstructorViewModel}">
        <StackPanel>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="150" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>

                <Label Content="Constructor type"
                       Grid.Row="0"
                       Grid.Column="0"
                       Margin="2" />
                <TextBox Text="{Binding Type, Mode=OneWay, ValidatesOnDataErrors=True, ValidatesOnExceptions=true}"
                         IsReadOnly="True"
                         Grid.Row="0"
                         Grid.Column="1"
                         Margin="2" />

                <Label Content="Constructor ID"
                       Grid.Row="1"
                       Grid.Column="0"
                       Margin="2" />
                <TextBox Text="{Binding Id, ValidatesOnDataErrors=True, ValidatesOnExceptions=true}"
                         Grid.Row="1"
                         Grid.Column="1"
                         Margin="2" />

                <Label Content="Disable constructor"
                       Grid.Row="2"
                       Grid.Column="0"
                       Margin="2" />
                <CheckBox Grid.Row="2"
                          Grid.Column="1"
                          Margin="2"
                          VerticalAlignment="Center"
                          IsChecked="{Binding Path=Disabled}" />

                <Label Content="Description"
                       Grid.Row="3"
                       Grid.Column="0"
                       Margin="2" />
                <TextBox Text="{Binding Description, ValidatesOnDataErrors=True, ValidatesOnExceptions=true}"
                         Grid.Row="3"
                         Grid.Column="1"
                         TextWrapping="Wrap"
                         VerticalScrollBarVisibility="Visible"
                         AcceptsReturn="True"
                         Height="100"
                         SpellCheck.IsEnabled="True"
                         Margin="2" />

                <Label Content="Target attribute"
                       Grid.Row="4"
                       Grid.Column="0"
                       Margin="2" />
                <ComboBox ItemsSource="{Binding Path=AllowedAttributes}"
                          SelectedItem="{Binding Attribute, ValidatesOnDataErrors=True, ValidatesOnExceptions=true}"
                          DisplayMemberPath="Name"
                          Grid.Row="4"
                          Grid.Column="1"
                          Margin="2"
                          IsEditable="true">

                </ComboBox>

                <ContentPresenter Grid.Row="5"
                                  Grid.ColumnSpan="2"
                                  Margin="0,10,0,0">
                    <ContentPresenter.Resources>
                        <ResourceDictionary Source="pack://application:,,,/Lithnet.Acma.Presentation;component/ResourceDictionaries/AttributeConstructorViewDictionary.xaml" />
                    </ContentPresenter.Resources>
                </ContentPresenter>
            </Grid>
        </StackPanel>
    </DataTemplate>
</ResourceDictionary>